package com.atguigu.chapter02

object Test04 {
  def main(args: Array[String]): Unit = {
    //    3）函数可以作为函数返回值返回
    def sumByX(x:Int) = {
      def sumXY(y: Int): Int = {
        x + y
      }

      sumXY _
    }

    val function: Int => Int = sumByX(10)
    println(function)
    val i1: Int = function(20)
    println(i1)

    val i2: Int = sumByX(10)(20)
    println(i2)
  }

}
